Re: [SQL] uncorrelated subqueries

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] uncorrelated subqueries
Дата
Msg-id l03130305b3ae5b9cac2f@[147.233.159.109]
обсуждение исходный текст
Ответ на Re: [SQL] uncorrelated subqueries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
At 22:30 +0300 on 08/07/1999, Tom Lane wrote:


> The main problem that would have to be solved to convert this to
> an InitPlan is what to do if the subselect returns a huge number
> of tuples ... with the current implementation, since we scan the
> tuples one at a time, there's no problem, but if we try to store
> all the tuples we could run out of memory.

How about putting them in a temporary table if the number of returned
tuples is big? Although the scan on the temp table will be sequential, it's
still not the same as scanning the original table (checking conditions and
perhaps even joining). If the internal query is ran on a 3 million record
table, and returns a million of them, it's worthwhile storing in a temp
table.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




В списке pgsql-sql по дате отправления:

Предыдущее
От: Herouth Maoz
Дата:
Сообщение: Re: [SQL] Bad date representation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Re: [HACKERS] SELECT DISTINCT question